# 6.py
# 海象运算符

# 7.py
# data class

from dataclasses import dataclass

@dataclass
class Person:
  name: str
  age: int
  # def __init__(self, name:str, age:int):
  #   self.name = name
  #   self.age = age
  # def __repr__(self):
  #   return f'Person(name={self.name}, age={self.age}'

if __name__ == '__main__':
  person1 = Person('wyl350', 18)
  person2 = Person('wyl350', 20)
  person3 = Person('wyl350', 18)
  print(person1)
  print(person2)
  print(person1 == person2)
  print(person1 == person3)


# 8.py
# 格式化输出技巧

text = 'hello'
print(f'{text}')
print(f'{text:#<15}')
print(f'{text:#>15}')
print(f'{text:#^15}')

